<#assign havevalue= "com.enation.app.shop.front.tag.goods.HaveValueDirectiveModel"?new()>

<style>
.slt .layui-unselect{width: 300px;float:left;}
.same-unit{float:left;margin:0 0 0 10px;line-height:38px;}
.w300{width:300px;float:left;}
</style>

<#if attrList?exists || brandList?exists >
	
	<div class="layui-form-item">
		<label class="layui-form-label">计价单位</label>
		<div class="layui-input-block">
			<input type="text" name="unit" autocomplete="off" placeholder="请输入计价单位" class="layui-input w300" value="${goods.unit!''}" >
		</div>
	</div>
	
	<#if brandList?exists >
	<div class="layui-form-item slt">
		<label class="layui-form-label">品牌</label>
		<div class="layui-input-block">
			<select name="brand_id" lay-verify="">
				<option value="">请选择</option> 
				<#list brandList as brand>
				<option value="${brand.brand_id }"
					<#if goods.brand_id?exists && goods.brand_id= brand.brand_id>selected="true"</#if> >${brand.name }</option> 
				</#list>
			</select>  
		</div>
	</div>
	</#if> 
	
	<#if attrList?exists > 
		<#list attrList as attr>
		<input type="hidden" name="propnames" value="${attr.name }" />
			<div class="layui-form-item slt">
				<label class="layui-form-label">${attr.name }</label>
				<div class="layui-input-block">
					<#if attr.type<3 > 
						<input type="text" name="propvalues"  autocomplete="off" class="layui-input w300" value="${attr.value}" 
						<#if attr.datatype?exists && attr.datatype!=''>
						dataType="${attr.datatype}"
						</#if>
						<#if attr.required==1>
							lay-verify="required" data-options="required:true
							<#if attr.datatype?exists && attr.datatype!=''>
								<#if attr.datatype=='int'>
									,validType:'integ'
								<#elseif attr.datatype=='float'>
								,validType:'mone'
								</#if>
							</#if> "
						</#if> />
						<p class="same-unit">/${attr.unit!''}</p> 
						
					</#if>
					<#if (attr.type>=3) && (attr.type<=5)>
						<select name="propvalues"  class="input_text w300" editable="false"
							<#if attr.datatype?exists && attr.datatype!=''>
								dataType="${attr.datatype}"
							</#if> 
							<#if attr.required==1>
								lay-verify="required" validType="selectValueRequired"
							</#if> 
							>
							<option value="">请选择</option> 
							<#list attr.optionAr as option>
								<option value="${option_index }"
								<#if attr.value==(""+option_index)>selected</#if> >${option }</option> 
							</#list>
						</select>
						<p class="same-unit">/${attr.unit!''}</p> 
					</#if>
					<#if (attr.type==6) > 
					<input type="hidden" name="propvalues" id="attr_${attr_index}" value="${attr.value!''}">
						<#list attr.optionAr as option> 
							<label>
								<input type="checkbox" value="${option}" lay-skin="primary" attrid="attr_${attr_index}" class="check"
								<@havevalue v1="${attr.value}" v2="${option}" /> />${option}
							</label> 
						</#list>
					</#if>
				</div>
			</div>
		</#list>
	</#if>

<#else> 
		该类型未字义属性或品牌
</#if>
